def func1():
    x = 49
    y = x**0.5 - 7
    print(y)


def func2():
    x = 70
    y = x**0.5 - 7
    print(y)
    return y


def func3(x):
    y = x**0.5 - 7
    return y


def func4(x=50):
    y = x**0.5 - 7
    return y


def calculate(a, b, operation="add"):  # a 和 b 是位置形参，operation 是命名形参
    if operation == "add":
        return a + b
    elif operation == "substract":
        return a - b
    else:
        return None


def func6(a, /, b, operation="add"): 
    if operation == "add":
        return a + b
    elif operation == "substract":
        return a - b
    else:
        return None


def func7(a, /, b, *, operation="add"): 
    if operation == "add":
        return a + b
    elif operation == "substract":
        return a - b
    else:
        return None


def func8(*numbers):
    total = 0
    for num in args:
        total += num
    return total


def func9(**user):
    for key, value in user.items():
        print(f"{key}: {value}")


def func10(arg1, arg2, named_arg="default"):
    print(f"位置实参 arg1: {arg1}")
    print(f"位置实参 arg2: {arg2}")
    print(f"命名实参 named_arg: {named_arg}")


def func12(arg1: str, arg2: named_arg: str = "default") -> None
    """
    多个参数的调用例子

    Parameters
    ----------
    arg1: str
        第一个参数
    arg2: int
        第二个参数

    Returns
    -------
    None
    """
    print(f"位置实参 arg1: {arg1}")
    print(f"位置实参 arg2: {arg2}")
    print(f"命名实参 named_arg: {named_arg}")